#pragma once

#include "CoreMinimal.h"
#include "DateTime.h"

#include <functional>
#include <time.h>
#include <sys/timeb.h>

#include "google/protobuf/message.h"

#define CONNECTION_STATE_CONNECTED 1
#define CONNECTION_STATE_FAILED 2
#define CONNECTION_STATE_TIMED_OUT 3
#define CONNECTION_STATE_DISCONNECTED 10

typedef std::function<void()> FunctionPtr;
typedef std::function<void(google::protobuf::Message*)> MessageHandler;

FORCEINLINE uint64 GetCurrentMillisecondTimestamp() {
	timeb t;
	ftime(&t);
	return (uint64)t.time * 1000 + (uint64)t.millitm;
}
